package io.renren.modules.sys.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.sys.dao.DictDataManagerDao;
import io.renren.modules.sys.entity.DictDataManagerEntity;
import io.renren.modules.sys.service.DictDataManagerService;


@Service("dictDataManagerService")
public class DictDataManagerServiceImpl extends ServiceImpl<DictDataManagerDao, DictDataManagerEntity> implements DictDataManagerService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<DictDataManagerEntity> page = this.page(
                new Query<DictDataManagerEntity>().getPage(params),
                new QueryWrapper<DictDataManagerEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<DictDataManagerEntity> getAllListByCode(String code) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("dict_code",code);
        return this.baseMapper.selectList(queryWrapper);
    }

}
